<template>
  <div>
    部门页面
    <ul>
      <li>
        <router-link to="/dept/news">News</router-link>
      </li>
      <li>
        <router-link to="/dept/msg">msg</router-link>
        <!-- <el-button type="parmary" @click="goMsg('/dept/msg')">去msg</el-button> -->
      </li>
      <li style="width: 200px; height: 100px; background-color: red">
        <router-view></router-view>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  methods: {
    goMsg(url) {
      console.log("去msg");
      //this.$router 获取到路由对象  push向路由对象中添加一个路由地址
      //this.$router.push(url);//单个

      // this.$router.push({
      //   name:'alibaba',
      //   params: {
      //     idd: 5,
      //     title: xx,
      //   }, //参数
      // });
      // this.$router.replace(); //替换当前路由地址
      // this.$router.forward(); //前进
      // this.$router.back(); //后退
      // this.$router.go(); //可前进 可后退，正数前进   负数后退
    },
  },
};
</script>

<style>
</style>